#ifndef GLOBAL_QUEUE_H
#define GLOBAL_QUEUE_H

#include "dfruntime.h"

/* This file describes a global queue, aiming at sharing work through OpenMP instances living in different processes, by randomized work stealing. To steal work, we need :
 * - A registery : provides the localization of the queues of all the nodes.
 * - A queue per node.
 */
 

// Intermediate buffer.

#ifdef __cplusplus
extern "C" {
#endif


void gqueue_init_pre_fork();
void gqueue_init_last();
void gqueue_append( struct frame_struct *fp);
void gqueue_export_interbuf();
int gqueue_reacquire_interbuf();
int gqueue_steal_local( int minimum );
int gqueue_steal_tasks( int minimum );
void gqueue_set_termination_bit( bool val );
#ifdef __cplusplus
}
#endif
#endif

